﻿
@model IEnumerable<WebVideo.EntityCommentVideo>
   @{
    //Session["AdminId"] = "Admin"; 
       if (System.Web.HttpContext.Current.Request.Cookies["userId"] == null)
     {
         Response.Redirect(@Url.Action("Index", "Index"));
     }
     
}
@{
    foreach(var item in Model)
    {
                    <div class="cmt-it">
                                        	
                                                    @{
                                                        
                                                        if (item.UserName == Request.Cookies["UserId"].Value)
                                                        {
                                                            <li class="dropdown">
                                                                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><b class="caret"></b></a>
                                                                <ul class="dropdown-menu">
                                                             @*<li id="CommentEdit"><input type ="hidden" value="@item.Id"/><a href="#frmEditCmt" role="button" data-toggle="modal">Sửa</a></li>*@
                                                             <li><a href="#" onclick="return DeleteComment(@item.Id)">Xóa</a></li>
                                                                </ul>
                                                            </li>
                                                         }
                                      
                                                    }
                                             
                                
                                        	<div class="img">@{
                                             if (item.EntityUser.Avatar != null)
                                             {
                                             string v = "~/Content/Images/Avatar/" + item.EntityUser.Avatar; 
                                                            <img src="@Url.Content(v)" />
                                         }
                                         else 
                                         {
                                                <img src="../../Content/cssFrontEnd/images/avatar.jpg" />
                                             }
                                             }
                                                            </div>
                                            <div class="cmt-cnt"><a href="@Url.Action("ThongTinCaNhan", "Individual", new { Friend = @item.UserName }, null)">@item.UserName </a>: @item.Des 
                                            	<div class="info">
                                                	<span>@item.Date.Value.ToString("hh:mm dd-MM-yyyy")</span>&nbsp;.&nbsp;
                                                    <a href="#" onclick="return LikeComment(@item.Id)" >Thích</a>&nbsp;.&nbsp;
                                                    <a href="#" class="n-like" data-toggle="tooltip" data-placement="top" title="" >@item.Likes</a>
                                                </div><!--/ .info-->
                                            </div><!--/ .cmt-cnt-->
                                             
            
                    </div><!--/ .cmt-it-->
    }
    if(Request.Cookies["UserType"].Value == "1")
    {
        <div class="cmt-it">                                        	
              <div class="img">@{  
                   if (System.Web.HttpContext.Current.Request.Cookies["UserAvatar"].Value != "")
            {
                  string k = "~/Content/Images/Avatar/" + System.Web.HttpContext.Current.Request.Cookies["UserAvatar"].Value; 
                   <img src="@Url.Content(k)" />
              }
              else
              {<img src="../../Content/cssFrontEnd/images/avatar.jpg" />
                   }
              
              }</div>
              <div class="cmt-cnt">
                    <input type="text" placeholder="Bình luận của bạn..!"  id ="CommentVideo" onkeypress="return Comment(event)" />
              </div><!--/ .cmt-cnt-->
        </div><!--/ .cmt-it-->
    }
}
